const puppeteer = require('puppeteer');

(async () => {
    const browser = await puppeteer.launch();
    const page = await browser.newPage();

    try {
        await page.goto('http://quote.eastmoney.com/sh600066.html', { timeout: 60000 }); // 设置页面加载超时时间为 60 秒
    } catch (error) {
        console.error('Navigation timeout error:', error);
    }

    // 等待页面加载完成
    await page.waitForSelector('.sider_brief');

    const stockName = await page.$eval('.sider_brief', element => element.textContent.trim());

    console.log('股票名称:', stockName);

    await browser.close();
})();
